<template>
  <div class="dialog-form">
    <el-form :model="form" label-width="120px">
      <el-row :gutter="36">
        <el-col :span="12">
          <el-form-item label="所属公司：">{{ form.companyName }}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="司机编号：">{{ form.driverNo }}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="司机姓名：">{{ form.name }}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="司机性别：">
            <dict-tag :options="bus_driver_sex" :value="form.sex" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="负责车辆：">{{ form.busNo }}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="手机号：">{{ form.phone }}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="入职日期：">{{ form.inductionDate }}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="状态：">
            <div v-if="form.status == 1">启用</div>
            <div v-else-if="form.status == 2">禁用</div>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="居住地址：">{{ form.address }}</el-form-item>
        </el-col>
        <!-- <el-col :span="12">
          <el-form-item label="创建时间：">{{ form.createTime }}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="更新时间：">{{ form.updateTime }}</el-form-item>
        </el-col> -->
      </el-row>
    </el-form>
    <div class="dialog-footer">
      <el-button type="primary" @click="onCancel">关闭</el-button>
    </div>
  </div>
</template>

<script setup>
import { getDriver } from "@/api/bus/driver"

const { proxy } = getCurrentInstance()
const { bus_driver_sex } = proxy.useDict("bus_driver_sex")

const emits = defineEmits(['cancel', 'confirm'])

const form = ref({})

const pageInit = (id) => {
  getDriver(id).then(response => {
    form.value = response.data
  })
}

const onCancel = () => {
  emits('cancel')
}

const onConfirm = () => {
  
}

defineExpose({
  pageInit
})

</script>

<style lang="scss" scoped>

</style>